<template>
	<view  class="order-detail">
		<u-cell-item title="售后信息" :arrow="false"></u-cell-item>
		<view class="o-d-base">
			<view>订单类型：{{orderTypeText[saleOrderData.orderType]}}</view>
			<view>订单号：{{saleOrderData.orderNo || '暂无'}}</view>
			<view>售后单号：{{saleOrderData.saleNo || '暂无'}}</view>
			<view>售后单状态：<text :style="{color: saleOrderData.status != 9 ? '#357CD4' : '#EA313A'}">{{orderStatusList[saleOrderData.status]}}</text></view>
			<view>买家手机号：{{saleOrderData.mobile || '暂无'}}</view>
			<view>申请退款金额：{{saleOrderData.afterSaleAmount || '暂无'}}</view>
			<view>申请退款糖果：{{saleOrderData.sweetRefund || '暂无'}}</view>
			<view>实际支付金豆：{{saleOrderData.actualPayGoldenBean || '暂无'}}</view>
			<view>退款金豆数量：{{saleOrderData.goldenBeanRefund || '暂无'}}</view>
			<view>售后类型：{{afterSaleTypeText[saleOrderData.afterSaleType]}}</view>
			<view>售后描述：{{saleOrderData.afterSaleDescription || '暂无'}}</view>
			<view>交易编号：{{saleOrderData.refundId}}</view>
			<view>申请售后时间：{{saleOrderData.timeApplication || '暂无'}}</view>
			<view>处理售后时间：{{saleOrderData.timeOperation}}</view>
		</view>
		<u-gap height="14" bg-color="#F0F0F0"></u-gap>
		<u-cell-item title="商品信息" :arrow="false"></u-cell-item>
		<view v-for="(item,index) in productVOS" :key="index">
			<view class="o-d-card u-flex">
				<image class="card-img" :src="item.productImageUrl" mode=""></image>
				<view class="u-flex-1" style="min-width:0">
					<view style="font-size: 28rpx;">{{item.productName || '暂无'}}</view>
					<view class="u-flex u-row-between" style="margin-top: 60rpx;font-size: 30rpx;">
						<view class="u-flex-1">
							￥34{{item.productUnitPrice}}
						</view>
						<view class="">
							x2{{item.productUnit}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<u-gap height="14" bg-color="#F0F0F0"></u-gap>
	</view>
</template>
<script>
	import dataJs from './data.js'
	export default {
		data() {
			return {
				id: '',
				saleOrderData: {},
				productVOS: [1],
				afterSaleTypeText: {
					1: '仅退款',
					2: '退款退货'
				},
				orderStatusList: {
					0: "处理中",
					1: "审核通过",
					2: "审核拒绝",
					3: "用户已邮寄, 待卖家确认收货",
					9: "退款成功",
					4: "退款处理中",
					5: "退款失败"
				},
				orderTypeText: dataJs.orderTypeText,
			}
		},
		onLoad(option) {
			this.id = option.id;
			this.getDetail()
		},
		methods: {
			getDetail() {
				this.$u.api.getAfterSaleDetail({
					orderAfterSaleId: this.id,
				}).then(res=>{
					if(res.code == 0){
						this.saleOrderData = res.data;
						this.productVOS = res.data && res.data.productVOS;
					}else{
						uni.showToast({
							icon:'none',
							title: res.msg
						});
					}
				})
			}
		}
	}
</script>

<style scoped>
.primary {
	color: #357CD4;
}
.hui {
	color: #999999;
}
.o-d-base {
	padding: 25rpx 30rpx 20rpx 30rpx;
	font-size: 26rpx;
	line-height: 44rpx;
}
.card-img {
	margin-right: 30rpx;
	width: 166rpx;
	height: 166rpx;
	border-radius: 10rpx;
	font-size: 24rpx;
}
.o-d-card {
	padding: 23rpx 30rpx 20rpx 30rpx;
	font-size: 24rpx;
}
.o-d-card-info {
	padding: 0 30rpx 10rpx 30rpx;
	font-size: 24rpx;
}
</style>

